<!DOCTYPE html>
<!-- video 播放器 -->
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.bootcss.com/video.js/7.5.4/alt/video-js-cdn.min.css" rel="stylesheet">

    <title>Document</title>
</head>

<body>
    <div>
        <video id="my-video" class="video-js vjs-default-skin" controls preload="auto" width="640" height="300">
            <source src="http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8">
            <p class="vjs-no-js">播放视频需要启用 JavaScript，推荐使用支持HTML5的浏览器访问。
                To view this video please enable JavaScript, and consider upgrading to a web browser that
                <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
            </p>
        </video>
    </div>

</body>

<script src="https://cdn.bootcss.com/video.js/7.5.4/video.min.js"></script>
<script src="https://cdn.bootcss.com/videojs-flash/2.2.0/videojs-flash.min.js"></script>

<script>
    //初始化视频
    let player = videojs('my-video', {
        //像data-setup那样设置的参数
    }, function onPlayerReady() {
        //视频播放器初始化完毕，就会调用这个回调函数
        console.log('视频播放器初始化完毕');
        // player = this
        // player.src({
        //     src: "rtmp://202.69.69.180:443/webcast/bshdlive-pc",
        //     type:'rtmp/flv'
        //     // src: "https://cdn.letv-cdn.com/2018/12/05/JOCeEEUuoteFrjCg/playlist.m3u8",
        //     // type:'application/x-mpegURL'
        // });
        // player.load("rtmp://202.69.69.180:443/webcast/bshdlive-pc")  
        // this.play()
    });

    player.play()


    /*
        其他格式的有
            {
            name: "毒液",
            src:
                "https://cdn.letv-cdn.com/2018/12/05/JOCeEEUuoteFrjCg/playlist.m3u8",
            type: "application/x-mpegURL",
            },
            {
            name: "CCTV1",
            src: "http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8",
            type: "application/x-mpegURL",
            },
            {
            name: "CCTV3",
            src: "http://ivi.bupt.edu.cn/hls/cctv3hd.m3u8",
            type: "application/x-mpegURL",
            },
            {
            name: "CCTV6",
            src: "http://ivi.bupt.edu.cn/hls/cctv6hd.m3u8",
            type: "application/x-mpegURL",
            },
            {
            name: "香港财经",
            src: "rtmp://202.69.69.180:443/webcast/bshdlive-pc",
            type: "rtmp/flv",
            },
            {
            name: "香港卫视",
            src: "rtmp://live.hkstv.hk.lxdns.com/live/hks1",
            type: "rtmp/flv",
            },
            {
            name: "苹果手机",
            src:
                "https://www.apple.com/105/media/us/iphone-x/2017/01df5b43-28e4-4848-bf20-490c34a926a7/films/feature/iphone-x-feature-tpl-cc-us-20170912_1920x1080h.mp4",
            type: "video/mp4",
            },
    */
</script>

</html>